#! /usr/bin/python

import boggle

def load_test_dictionary():
  filename = "fulldictionary00.txt"
  filehandle = open(filename, "rU")
  fileastext = filehandle.read()
  words = fileastext.split()
  size = boggle.add_word(words)

  dict = {}
  for word in words:
   dict[word] = 1 
  
  pysize = dict.__sizeof__()

  list = ['a', 'samip' , 'jay', 'abacus', 'beautiful', 'sagar', 'jungle', 'queen', 'requiem']
  result = []
  print boggle.check_answers(list)
  for word in list:
    res = boggle.check_word(word)
    result.append(res)

  pyresult = []
  for word in list:
   res = word in dict 
   pyresult.append(res)

  print "Size: " + str(size)
  print list
  print result

  print "Python Dict Size: " + str(pysize)
  print list
  print pyresult
    

def main():
  list = []
  length = 4
  width = 4
  ret = boggle.generate_board(list, length, width)
  print ret
  print list
  load_test_dictionary()

if __name__ == "__main__":
  main()
